package com.tyc.mb.common;

import com.tyc.mb.model.LogType;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.MarkerManager;
import org.apache.logging.slf4j.Log4jMarker;

/**
 * 用于打印需要入库的日志数据
 *
 * @author tyc
 * @version 1.0
 * @date 2021-10-28 14:44:35
 */
@Slf4j(topic = "data")
public class LogData {
    public static Log4jMarker marker = new Log4jMarker(MarkerManager.getMarker("DATA"));

    /**
     * 记录需存储日志
     * @param logType 数据类型
     * @param msg json数据
     */
    public static void record(LogType logType, String msg){
        log.info(marker,"{}|{}", logType.getType(), msg);
    }
}
